package com.example.lotterysystem.service.dto;

import com.example.lotterysystem.service.enums.ActivityPrizeStatusEnum;
import com.example.lotterysystem.service.enums.ActivityPrizeTiersEnum;
import com.example.lotterysystem.service.enums.ActivityStatusEnum;
import com.example.lotterysystem.service.enums.ActivityUserStatusEnum;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@Data
public class ActivityDetailDTO implements Serializable {
    //活动信息
    private Long activityId;
    private String activityName;
    private String desc;
    private ActivityStatusEnum status;
    public Boolean valid(){
        return status.equals(ActivityStatusEnum.RUNNING);
    }
    //奖品信息
    private List<PrizeDTO> prizeDTOList;
    //人员信息
    private List<UserDTO> userDTOList;
    @Data
    public static class PrizeDTO{
        private Long id;
        private String name;
        private String imageUrl;
        private BigDecimal price;
        private String description;
        //奖品等级
        private ActivityPrizeTiersEnum tiers;
        //奖品数量
        private Long prizeAmount;
        //奖品状态
        private ActivityPrizeStatusEnum status;
        public Boolean valid(){
            return status.equals(ActivityPrizeStatusEnum.INIT);
        }
    }
    @Data
    public static class UserDTO{
        private Long userId;
        private String userName;
        private ActivityUserStatusEnum status;
        public Boolean valid(){
            return status.equals(ActivityUserStatusEnum.INIT);
        }
    }

}
